package palindrome;

import static org.junit.Assert.*;
import org.junit.Test;

import static palindrome.PalindromeChecker.*;

public class PalindromeCheckerTest {

    @Test
    public void testWithPalindromeWord() {
        String[] words = {
            "abccba", "civic", "radar", "level", "rotor", "kayak", "reviver", "racecar", "redder"
        };
        
        for (String word : words) {
            assertTrue(isPalindromeWord(word));
        }
        
    }
    
    @Test
    public void testWithInvalidString() {
        String invalidString = "abccaa";
        boolean isPalindrome = PalindromeChecker.isPalindromeWord(invalidString);
        assertFalse(isPalindrome);
    }
    
    
    @Test
    public void testWithPalindromePhrases() {
        String[] phrases = {
                "Was it a rat I saw?"
        };
        
        for (String phrase : phrases) {
            assertTrue(isPalindromePhrase(phrase, PharseCheckMode.ONLY_ALPHABET_AND_NUMBERS));
        }
    
    }
    
    

}
